Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas 1.3.0 compatibility #49

Merged
merged 3 commits into from
Apr 7, 2021
Merged

Conversation

jrbourbeau
Copy link
Member

This PR adds support for pandas 1.3.0. cc @jorisvandenbossche if you get a chance to take a look

Closes #48, xref dask/dask#7507

@@ -129,7 +141,7 @@ def block_to_header_bytes(block):
elif is_datetime64tz_dtype(block):
extension = ('datetime64_tz_type', (block.values.tzinfo,))
values = values.view('i8')
elif is_extension_array_dtype(block.dtype):
elif is_extension_array_dtype(block.dtype) or is_extension_array(values):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you could also replace this with elif isinstance(values, ExtensionArray), and I would think this should work for older versions of pandas as well.

(but the current PR should work as well, I think)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing @jorisvandenbossche! I avoided a pure isinstance(values, ExtensionArray) check since partd supports older versions of pandas which predate the ExtensionArray class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sounds good then!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also do a not isinstance(values, np.ndarray) (unless you support pandas so old that it can still be a CategoricalIndex or something)

@jrbourbeau jrbourbeau merged commit 2b684d8 into dask:main Apr 7, 2021
@jrbourbeau jrbourbeau deleted the pandas-1.3.0-compat branch April 7, 2021 15:57
@jorisvandenbossche
Copy link
Member

@jrbourbeau do you plan to do a bugfix release with this change?

@jrbourbeau
Copy link
Member Author

Yes. I'm checking that this resolves the issue reported in dask over in dask/dask#7534

This was referenced Apr 7, 2021
@jrbourbeau
Copy link
Member Author

Opened up an issue for releasing over at #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pandas 1.3.0 compatibility
3 participants